<extend name="Common@Layout:layui" />
<block name="title">
    <title>编辑权限</title>
</block>
<block name="style">
    <style>
        .layui-fixbar {
            display: none !important;
        }
        
        .img-wrap {
            width: 80px;
            height: 80px;
            display: table-cell;
            vertical-align: middle;
            text-align: center;
            cursor: pointer;
        }
        
        .img-wrap img {
            width: 100%;
            height: 100%;
        }
    </style>
</block>

<block name="main">
    <div class="layui-main" style="width:auto">
        <if condition="!$info['group_id']">
            <blockquote class="layui-elem-quote">当前未选择所属权限，无法执行编辑操作</blockquote>
        </if>
        <form class="layui-form callback shuaxin" action="{:U('rule_edit_post')}" method="post" style="margin-top:20px;">

            <div class="layui-form-item">
                <label class="layui-form-label">*父节点：</label>
                <div class="layui-input-inline">
                    <select name="parentid">
                        <option value="0" <if condition="$info['parentid'] eq 0">selected</if>>根节点</option>
                        {$select_categorys}
                    </select>

                </div>
                <if condition="$info['id']">
                    <span style="line-height:38px;color:red">当前权限ID：<b>{$info.id}</b></span>
                </if>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">*权限标题：</label>
                <div class="layui-input-inline">
                    <input type="text" style="width:400px;" name="title" value="{$info.title}" placeholder="请输入权限标题" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">*权限名：</label>
                <div class="layui-input-inline">
                    <input type="text" style="width:400px;" name="name" value="{$info.name}" placeholder="请输入权限名" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">封面图</label>
                <div class="layui-input-block">
                    <input type="text" id="fengmian" name="img" style="width:400px;display:inline-block" value="{$info.img}" placeholder="请输入封面图地址" class="layui-input">
                    <a href="javascript:;" id="fengmianupload" class="layui-btn">上传图片</a>
                    <div class="img-wrap" id="fengmian-box" style="background:#f8f8f8;text-align:center;">
                        <if condition="$info['img']">
                            <img src="{$info.img}">
                            <else/>
                            <span style="font-size:30px;line-height:80px;color:#eee;">封面</span>
                        </if>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">排序值：</label>
                <div class="layui-input-inline">
                    <input type="text" name="listorder" value="{$info.listorder|default=0}" placeholder="输入val值" lay-verify="required" autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <input type="hidden" name="id" value="{$info.id}">
                    <input type="hidden" name="group" lay-verify="required" value="{$info.group}">
                    <button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
                </div>
            </div>
        </form>

    </div>
</block>


<block name="script">
    <script>
        layui.use(['jquery', 'ruleadmin'], function() {

        });
    </script>
</block>